using ProcessManagementApi.DTOs;
using MESData.ErrorCode;

namespace ProcessManagementApi.Services
{
    /// <summary>
    /// 工艺流程服务接口
    /// </summary>
    public interface IProcessFlowService
    {
        /// <summary>
        /// 分页查询工艺流程
        /// </summary>
        /// <param name="query">查询条件</param>
        /// <returns>分页结果</returns>
        Task<ApiPageing<ProcessFlowResponseDto>> GetProcessFlowsAsync(ProcessFlowQueryDto query);

        /// <summary>
        /// 根据ID获取工艺流程详情
        /// </summary>
        /// <param name="id">工艺流程ID</param>
        /// <returns>工艺流程详情</returns>
        Task<ApiResult<ProcessFlowResponseDto>> GetProcessFlowByIdAsync(int id);

        /// <summary>
        /// 创建工艺流程
        /// </summary>
        /// <param name="createDto">创建DTO</param>
        /// <returns>创建结果</returns>
        Task<ApiResult<ProcessFlowResponseDto>> CreateProcessFlowAsync(ProcessFlowCreateDto createDto);

        /// <summary>
        /// 更新工艺流程
        /// </summary>
        /// <param name="updateDto">更新DTO</param>
        /// <returns>更新结果</returns>
        Task<ApiResult<ProcessFlowResponseDto>> UpdateProcessFlowAsync(ProcessFlowUpdateDto updateDto);

        /// <summary>
        /// 删除工艺流程
        /// </summary>
        /// <param name="id">工艺流程ID</param>
        /// <returns>删除结果</returns>
        Task<ApiResult<bool>> DeleteProcessFlowAsync(int id);

        /// <summary>
        /// 批量删除工艺流程
        /// </summary>
        /// <param name="ids">工艺流程ID列表</param>
        /// <returns>删除结果</returns>
        Task<ApiResult<bool>> BatchDeleteProcessFlowsAsync(List<int> ids);

        /// <summary>
        /// 生成工艺流程编号
        /// </summary>
        /// <returns>生成的工艺流程编号</returns>
        Task<ApiResult<string>> GenerateProcessFlowCodeAsync();

        /// <summary>
        /// 获取工艺流程的工序步骤
        /// </summary>
        /// <param name="id">工艺流程ID</param>
        /// <returns>工序步骤列表</returns>
        Task<ApiResult<List<ProcessFlowStepDto>>> GetProcessFlowStepsAsync(int id);

        /// <summary>
        /// 导出工艺流程步骤到Excel
        /// </summary>
        /// <param name="processFlowId">工艺流程ID</param>
        /// <returns>Excel文件字节数组</returns>
        Task<byte[]> ExportProcessFlowStepsToExcelAsync(int processFlowId);

        /// <summary>
        /// 打印工艺流程详情到PDF
        /// </summary>
        /// <param name="processFlowId">工艺流程ID</param>
        /// <returns>PDF文件字节数组</returns>
        Task<byte[]> PrintProcessFlowDetailsToPdfAsync(int processFlowId);
    }
} 